package com.xue.zuoye;

import java.math.BigDecimal;

public class Task1 {
    public static void main(String[] args) {
          test();
    }

   private static void test(){
       double   f   =   111231.5545;
       BigDecimal   b   =   new   BigDecimal(f);
       double   f1   =   b.setScale(2,   BigDecimal.ROUND_HALF_UP).doubleValue();
       System.out.println("原来的值：："+f);
       System.out.println("四舍五入的值：："+f1);


}
}
